import pinia from '@/store'
import 'virtual:uno.css'
import { createSSRApp } from 'vue'
import App from './App.vue'

import back from '@/components/back/index'

declare module 'vue' {
  export interface ComponentCustomProperties {
    $navigateTo: any
  }
}

export function createApp() {
  const app = createSSRApp(App)
  // 全局注册 NutToast 组件
  app.config.globalProperties.$navigateTo = (url: string) => {
    uni.navigateTo({
      url
    })
  }
  app.component('back', back)
  // app.component(copy);
  app.use(pinia)
  return {
    app
  }
}
